#!/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'

from PySide import QtGui, QtCore
from .pyuic.preview_widget import Ui_preview_widget
from .pyuic import resources_rc

class PreviewWidget(QtGui.QFrame):
    def __init__(self, parent=None):
        super(PreviewWidget, self).__init__(parent)
        self.ui = Ui_preview_widget()
        self.ui.setupUi(self)
        self.ui.play_frame.setVisible(0)

    def show_pixmap(self, image_path=None):
        self.ui.play_frame.setVisible(0)
        if image_path:
            # self.ui.preview_label.setStyleSheet('border-radius:20px;border:1px solid rgb(20,20,20);')
            self.ui.preview_label.setPixmap(image_path)

        else:
            self.ui.preview_label.setPixmap(':/icons/no_item_selected_512x400.png')

